{include file="header.html"}
<script type="text/javascript" src="/js/fancybox/jquery.mousewheel.js"></script>
<script type="text/javascript" src="/js/fancybox/jquery.fancybox.js"></script>
<link rel="stylesheet" type="text/css" href="/js/fancybox/jquery.fancybox.css" media="screen" />
{literal}
<style>
    td{
        border-bottom: double 1px #ddd;
    }
    td a{
        display: none;
    }
</style>
<script>
    $(document).ready(function(){
        $("td").mouseover(function(){
            $(this).find("a").show();
        }).mouseout(function(){
            $(this).find("a").hide();
        }).find("a").click(function(){
            v = $(this).attr("data-tag");
            msg = "<form action='/main/modinfo'>";
            msg += "<input type=hidden name=tag value="+v+" />";
            switch(v){
                case "password":
                    msg+="<p>旧密码<input type='password' name='old'/></p>";
                    msg+="<p>新密码<input type='password' name='new'/></p>";
                    msg+="<p>再一次<input type='password' name='agn'/></p>";
                    $("#mod").css("height","200");
                    break;
                default:
                    msg += "<p>新的"+$(this).parent().siblings(":first").html();
                    msg += "<input type='text' name='newv'/></p>";
                    $("#mod").css("height","100");
            }
            msg +="<p><input type=submit value=提交修改 /></p></form>"
            $("#mod").html(msg);
        }).fancybox({
            'titlePosition'		: 'inside',
            'transitionIn'		: 'none',
            'transitionOut'		: 'none'
        });

    })
</script>
{/literal}	
<div style="display: none;">
    <div id="mod" style="width:400px;height:100px;overflow:auto;">
    </div>
</div>

<div id="main">
    {if !empty($msg)}
    <p style="color:green">{$msg}</p>
    {/if}
    <table style="margin:auto;">
        <tr><td width="200px">用户名</td><td width="200px">{$user->username}</td></tr>
        <tr><td>Email</td><td>{$user->email}<a href="#mod" data-tag="email">修改</a></td></tr>
        <tr><td>角色</td><td>{$user->role}</td></tr>
        <tr><td>密码</td><td>*******<a href="#mod" data-tag="password">修改</a></td></tr>
        <tr><td>真实姓名</td><td>{$user->realname}</td></tr>
        <tr><td>联系电话</td><td>{$user->phone}<a href="#mod" data-tag="phone">修改</a></td></tr>
        <tr><td>入学年份</td><td>{$user->iyear}</td></tr>
        <tr><td>班级</td><td>{$user->class}</td></tr>
        <tr><td>工作单位</td><td>{$user->workunit}<a href="#mod" data-tag="workunit">修改</a></td></tr>
        <tr><td>注册时间</td><td>{$user->createtime}</td></tr>
        <tr><td>上次登录时间</td><td>{$user->lastlogintime}</td></tr>
    </table>
    <div class="clear"></div>

    <div style="display: none">
        <div id="pop" style="width:400px;height:100px;overflow:auto;">
        </div>
    </div>
</div>
{include file="footer.html"}